home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VB / UNSUPPRT / IHANDLER / TEST_IH / TEST_IH.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1997-01-16  |  3.5 KB  |  85 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTest 
  3.    Caption         =   "Test Icon Handler..."
  4.    ClientHeight    =   2790
  5.    ClientLeft      =   2775
  6.    ClientTop       =   2730
  7.    ClientWidth     =   4575
  8.    Icon            =   "Test_IH.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   2790
  11.    ScaleWidth      =   4575
  12.    Begin VB.ComboBox cmbGuids 
  13.       Height          =   315
  14.       Left            =   90
  15.       TabIndex        =   3
  16.       Top             =   300
  17.       Width           =   4395
  18.    End
  19.    Begin VB.TextBox txtOut 
  20.       Height          =   1485
  21.       Left            =   90
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   2
  25.       Top             =   1200
  26.       Width           =   4395
  27.    End
  28.    Begin VB.CommandButton cmdCallHandler 
  29.       Caption         =   "Call IconHandler From GUID"
  30.       Height          =   405
  31.       Left            =   90
  32.       TabIndex        =   0
  33.       Top             =   720
  34.       Width           =   4395
  35.    End
  36.    Begin VB.Label Label1 
  37.       AutoSize        =   -1  'True
  38.       Caption         =   "GUID:"
  39.       Height          =   195
  40.       Left            =   120
  41.       TabIndex        =   1
  42.       Top             =   60
  43.       Width           =   450
  44.    End
  45. Attribute VB_Name = "frmTest"
  46. Attribute VB_GlobalNameSpace = False
  47. Attribute VB_Creatable = False
  48. Attribute VB_PredeclaredId = True
  49. Attribute VB_Exposed = False
  50. Option Explicit
  51. '----------------------------------------------------------------
  52. Private Sub cmdCallHandler_Click()
  53. '----------------------------------------------------------------
  54.     Dim rf As Long                              ' Return flags
  55.     Dim Idx As Long                             ' Icon Index
  56.     Dim IconFile As String                      ' Icon file output
  57.     Dim Handler As cExtractIcon                 ' Object reference variable
  58. '----------------------------------------------------------------
  59.     Set Handler = New cExtractIcon              ' Instansiate cExtractIcon class.
  60.     txtOut.Text = ""                            ' Clear output textbox
  61.     ' Call IconHandler in GUID object...(Method 1)
  62.     Handler.GetIconLocation cmbGuids.Text, FOR_SHELL, Idx, IconFile, rf
  63.     txtOut.Text = txtOut.Text & IconFile        ' Display IconFile output
  64.     txtOut.Text = txtOut.Text & vbCrLf
  65.     ' Call IconHandler in GUID object...(Method 2)
  66.     Handler.GetIconLocation cmbGuids.Text, OPEN_ICON, Idx, IconFile, rf
  67.     txtOut.Text = txtOut.Text & IconFile        ' Display IconFile output
  68.     txtOut.Text = txtOut.Text & vbCrLf
  69.     Set Handler = Nothing                       ' Destroy handler object.
  70. '----------------------------------------------------------------
  71. End Sub
  72. '----------------------------------------------------------------
  73. '----------------------------------------------------------------
  74. Private Sub Form_Load()
  75. '----------------------------------------------------------------
  76.     ' Add a few known classid's that are known IconHandlers...
  77.     ' Note that these objects may not be installed on your system...
  78.     cmbGuids.AddItem "{FBF23B40-E3F0-101B-8488-00AA003E56F8}"
  79.     cmbGuids.AddItem "{00021401-0000-0000-C000-000000000046}"
  80.     cmbGuids.AddItem "{0006F045-0000-0000-C000-000000000046}"
  81.     cmbGuids.Text = cmbGuids.List(0)
  82. '----------------------------------------------------------------
  83. End Sub
  84. '----------------------------------------------------------------
  85.